package entity;

@SuppressWarnings("serial")
public class DALException extends Exception
{
	
	private String[] messages = {
		"General error.",
		"CPR already exists.",
		"No such operator was found in the database.",
		"The password you entered was not correct.",
		"The limit of users has been reached"
	};
	private int messageIndex = 0;
	
	public DALException(int messageIndex) {
		if(messageIndex < messages.length)
			this.messageIndex = messageIndex;
	}
	
	@Override
	public String getMessage() {
		return messages[messageIndex];
	}
}
